<?php

declare(strict_types=1);

require __DIR__ . '/../vendor/autoload.php';

use Core\App;

define('START_MEMORY', memory_get_usage());  // 开始内存
define('START_TIME', microtime(true));       // 开始时间
define('ROOT_PATH', strtr(realpath(__DIR__ . '/../'), '\\', '/') . '/');

$config = [
    'base_namespace'     => 'App\\Controllers\\',
    'default_controller' => 'Home',
    'default_method'     => 'index',
    'db_type'            => 'sqlite',
    'view_path'          => ROOT_PATH . 'app/views',
    'csrf_enabled'       => true,
    'xss_protection'     => true,
    'debug'              => true,
];

$app = App::getInstance($config);

$app->dispatch();
